<template>
  <div class="top-nav">
    <tab :line-width="2" active-color="#78edd7" v-model="index">
      <tab-item
        class="vux-center"
        :selected="selectedItem === item"
        v-for="(item, index) in list2"
        @click="selectedItem = item"
        :key="index"
      >{{item}}</tab-item>
    </tab>
  </div>
</template>
<script>
import { Tab, TabItem } from 'vux'

const list = () => ['新闻咨询', '专业成长', '文学天地', '娱乐生活', '外卖']

export default {
  name: 'TopNav',
  components: {
    Tab,
    TabItem
  },
  data () {
    return {
      index: 0,
      list2: list(),
      selectedItem: list()[0]
    }
  }
}
</script>
<style lang="less">
</style>
